local jiaojin = fk.CreateSkill{
    name = "tyj_heg__jiaojin",
}
Fk:loadTranslationTable{
      ["tyj_heg__jiaojin"]="骄矜",
      [":tyj_heg__jiaojin"]="你受到伤害时，可以将一张装备牌置入伤害来源的装备区内（替换原装备）以防止之。",
      ["#tyj_heg__jiaojin_active"]= "骄矜",
      ["#tyj_heg__jiaojin-invoke"]="是否将一张装备牌置于 %dest 的装备区内以发动 骄矜 来防止此伤害？",
      ["$tyj_heg__jiaojin1"]="是谁借给你的胆子？",
      ["$tyj_heg__jiaojin2"]="就凭你、还想算计于我？！",
    }

jiaojin:addEffect(fk.DetermineDamageInflicted,{
    anim_type = "offensive",
    can_trigger = function(self, event, target, player, data)
        if player:hasSkill(jiaojin.name) then
        return target == player and data.from and data.from:isAlive() and #player:getCardIds('he')>0
        end
      end,
    on_cost = function(self, event, target, player, data)
      local room = player.room
      room:setPlayerMark(player,"tyj_heg__jiaojin_from-phase",data.from.id)
      local success, dat = room:askToUseActiveSkill(player, {
      skill_name = "#tyj_heg__jiaojin_active",
      prompt = "#tyj_heg__jiaojin-invoke::"..data.from.id,
      extra_data = {skillName = jiaojin.name},
      cancelable = true,
    })
    room:setPlayerMark(player,"tyj_heg__jiaojin_from-phase",0)
        if success and dat then
          event:setCostData(self, {cards = dat.cards})
          return true
        end
      end,
      on_use = function (self, event, target, player, data)
        local room = player.room
        local to = data.from
        local card = event:getCostData(self).cards[1]
        if to and to:isAlive() then
        room:moveCardIntoEquip(to, card, jiaojin.name, true, player)
        data:preventDamage()
        end
      end,
})
return jiaojin